/*
题目链接:https://www.luogu.com.cn/problem/P1537
*/

//题解代码:
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define INF 0x3f3f3f3f
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
const int mod = 1e9+7;

void solve() {
    vector<int> a(7);
    int sum = 0;
    int k=0;
    while(1){
        ++k;
        sum = 0;
        for(int i=1;i<=6;++i) cin>>a[i],sum+=i*a[i];
        if(accumulate(a.begin(),a.end(),0) == 0) break;
        cout<<"Collection #"<<k<<":"<<endl;
        if(sum&1){
            cout<<"Can't be divided."<<endl<<endl;
            continue;
        }
        vector<int> val;
        for(int i=1;i<=6;++i){
            for(int j=1;j<=a[i];j<<=1){
                val.push_back(j*i);
                a[i] -= j;
            }
            if(a[i]) val.push_back(a[i]*i);
        }
        sum/=2;
        bitset<210000> f;
        f[0] = 1;
        for(int i=0;i<val.size();++i){
            //for(int j=sum;j>=val[i];--j){
                f |= f<<val[i];
            //}
        }
        
        if(f[sum]){
            cout<<"Can be divided."<<endl<<endl;
        }else{
            cout<<"Can't be divided."<<endl<<endl;
        }
    }
} 


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int t; t = 1;
    //cin >> t;
    while (t--) solve();
    return 0;
}



